<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>4.cors解决跨域_简单请求</title>
</head>

<body>
    <button onclick="getStudents()">获取学生列表</button>

    <script type="text/javascript">
        async function getStudents() {
            const url = 'http://127.0.0.1:8080/students'
            let result = await fetch(url, {method: 'GET'})
            let data = await result.json()
            console.log(data);
        }
    </script>
</body>

</html>